package com.baor.dao;
import com.baor.domain.OrderVo;
import com.baor.domain.conf.OrderConf;
import com.baor.domain.field.OrderSourceField;
import com.baor.domain.field.OrderStatusField;
import com.baor.domain.field.PayMethodField;
import com.github.yulichang.base.mapper.MPJJoinMapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
public interface OrderDao extends MPJJoinMapper<OrderVo>{
    List<Map<String, Object>> orderList(Map<String, Object> params);
    int pageCount(Map<String, Object> params);
    List<Map<String, Object>> orderInfo(Map<String, Object> params);
    int orderRemark(Map<String, Object> params);
    List<OrderSourceField> orderSourceList();
    List<PayMethodField> payMethodList();
    List<OrderVo> orderCodeList();
    List<OrderStatusField> orderStatusList();
    List<Map<String, Object>> orderNotes(Map<String, Object> params);
    List<Map<String, Object>> orderLogList(Map<String, Object> params);
    int updateOrderStatus(Map<String, Object> params);

//    @OrderLog
    int addOrder(Map<String, Object> params);
//    {
//        <!--  批量插入  -->
//<insert id="insertMovies" parameterType="map">
//            insert into movies(movieName,director,stardom,region ,showtime,description,image,price,typeID ) values
//            <foreach collection="movieList" item="item" separator=",">
//                (#{item.movieName},#{item.director},#{item.stardom},#{item.region}, #{item.showtime},#{item.description},#{item.image},#{item.price},#{item.typeID} )
//            </foreach>
//</insert>
//    }
    int addOrderSetting(Map<String, Object> params);
    List<OrderConf> orderSettingList(Map<String, Object> params);

    List<Map<String, Object>> userOrderList(Map<String, Object> params);
    int userPageCount(Map<String, Object> params);

    @Update("update t_order set order_status_id = 3 where order_code = #{orderCode}")
    int updateStatus(Map<String, Object> updateParams);

    Integer insertOrderVo(OrderVo orderVo);
}
